<template>
  <el-select v-model="value" placeholder="请选择" @change="changeValue($event)" clearable>
    <el-option
      v-for="item in partys"
      :key="item.code"
      :label="item.name"
      :value="item.code"
    />
  </el-select>
</template>
<script>
import request from '@/utils/request'
export default {
  data() {
    return {
      value: '',
      partys: [],
      callbackMethod: '',
      partyName: ''
    } 
  },
  created() {
    this.findShipmentPartys()
  },
  methods: {
    findShipmentPartys() {
      request({
        url: '/arpa-basic-api/party/wmsShipment',
        method: 'get',
        params: { name: this.partyName }
      }).then(response => {
        this.partys = response.data
      })
    },
    changeValue(e) {
      this.$emit("setnewCustomerCode", this.value)
    },
    setSelectValue1(value) {
      this.value = value
    },
    initDict(partys, callbackMethod) {
      this.partys = partys
      this.callbackMethod = callbackMethod
    }
  }
}
</script>
